<?php get_header(); ?>

<div id="content" class="grid_12">

	<h1 class="taxononomy-title">Bridge ID: <? echo single_tag_title(); ?></h1>

	<?php if (have_posts()) : ?> 
	<div class="grid_12 alpha">
    
    	<? while (have_posts()) : the_post(); ?>
			
            <h2><strong><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><? echo single_tag_title(); ?> | <?php the_time('l, F jS, Y') ?></a></strong></h2> 
            
			<?php $args = array(
										'order'          => 'ASC',
										'post_type'      => 'attachment',
										'orderby' => 'menu_order',
										'post_parent'    => $post->ID,
										'post_mime_type' => 'image',
										'post_status'    => null,
										'numberposts'    => -1,
										);
										$attachments = get_posts($args); ?>
										
					<?php if ($attachments) { ?>
						<?php $i = 0; ?>
			
						<?php // echo images
						foreach ($attachments as $attachment) { ?>
				
							<div class="grid_6 alpha">
								<?php echo wp_get_attachment_link($attachment->ID, array(400,400)); ?>
					            <?php $imageCaption = $attachment->post_excerpt; // this is the caption ?>
								<?php echo $imageCaption ?>
							</div>
							<?php $i++; ?>
							
					        <?php if ($i % 2 == 0) { // ?>
								<div class="clear"></div>
								<hr />
							<?php } ?>
				
						<?php } // end foreach ?>
						
				
					<?php } // end if  ?>
			<? the_content(); ?>


			
		<?php endwhile; ?>
	</div> <!-- end grid_12 -->
	<?php endif; ?>

</div><!-- #content -->

<?php get_footer(); ?>
